home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / src / mppmsg.h < prev    next >
C/C++ Source or Header  |  1997-07-22  |  4KB  |  132 lines

  1.  
  2. /* $Id: mppmsg.h,v 1.4 1997/07/09 13:52:36 pvmsrc Exp $ */
  3.  
  4. /*
  5.  *         PVM version 3.4:  Parallel Virtual Machine System
  6.  *               University of Tennessee, Knoxville TN.
  7.  *           Oak Ridge National Laboratory, Oak Ridge TN.
  8.  *                   Emory University, Atlanta GA.
  9.  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
  10.  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
  11.  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
  12.  *                   (C) 1997 All Rights Reserved
  13.  *
  14.  *                              NOTICE
  15.  *
  16.  * Permission to use, copy, modify, and distribute this software and
  17.  * its documentation for any purpose and without fee is hereby granted
  18.  * provided that the above copyright notice appear in all copies and
  19.  * that both the copyright notice and this permission notice appear in
  20.  * supporting documentation.
  21.  *
  22.  * Neither the Institutions (Emory University, Oak Ridge National
  23.  * Laboratory, and University of Tennessee) nor the Authors make any
  24.  * representations about the suitability of this software for any
  25.  * purpose.  This software is provided ``as is'' without express or
  26.  * implied warranty.
  27.  *
  28.  * PVM version 3 was funded in part by the U.S. Department of Energy,
  29.  * the National Science Foundation and the State of Tennessee.
  30.  */
  31.  
  32. #ifndef __mppmsg_h__
  33. #define __mppmsg_h__
  34.  
  35.  
  36. /* This library uses primitives of a native message passing system. Because
  37.  *    different routes may use different functions, the following documents 
  38.  *    the call sequence expected.
  39.  * 
  40.  int
  41.  imsgsend(int appid, int tag, char *buffer, int len, int dest, int partid,
  42.      msgmid_t *mid)
  43.      appid -    used for some host programs to identify application
  44.      dest -    destinations of message.
  45.      tag -     tag to use for sending the message 
  46.      datap -    buffer to send 
  47.      len    -    length of buffer (in bytes)
  48.      partid -partition id
  49.     mid -    message id of send message
  50.  
  51.      returns integer >= 0 on success. < 0 on failure.
  52.     message id is returned in mid.
  53.  
  54.  int
  55.  imsgrecv(int appid, int src, int tag, char *datap, int len, int partid,
  56.              int *info, msgmid_t *mid)
  57.      appid -    used for some host programs to identify application
  58.      src    -    src of message. -1 means any src
  59.      tag -     tag to match on message
  60.      datap -    buffer in which to receive message
  61.      len    -    max length of buffer (in bytes)
  62.      partid -partition id
  63.      info    - pointer to integer array of memory to store message information
  64.     mid     - pointer the recv message id
  65.  
  66.      returns integer >= 0 on success.  < 0 on failure.
  67.     message id returned in mid
  68.  
  69.  msgmid_t 
  70.  msgmerge(msgmid_t *mid1, msgmid_t *mid2)
  71.      mid1 - message id of message 1 (-1 indicates no existing message )    
  72.      mid2 - message id of message 2 (-1 indicates no existing message ) 
  73.      
  74.      returns mid3, merged id of message 1 and 2, if possible
  75.  
  76.  int
  77.  msgdone(int appid, msgmid_t mid, info_t *info)
  78.      appid -    used for some host programs to identify application
  79.      mid     -    message id of an incoming message (imsgrecv) or outgoing (imsgsend)
  80.      
  81.      returns 0, message not complete; 1 - message complete, < 0 error
  82.      
  83.  int
  84.  msgsrc(info_t *info)
  85.      info -    pointer to low-level message passing information block
  86.      
  87.      returns node of the message src
  88.  
  89.  int
  90.  msglen(info_t *info)
  91.      info -    pointer to low-level message passing information block
  92.      
  93.      returns length of the message given in info block
  94.  
  95.  int
  96.  msgtag(info_t *info)
  97.      info -    pointer to low-level message passing information block
  98.      
  99.      returns tag of the message 
  100.  
  101. */
  102. #if defined(IMA_SP2MPI) && defined(IMA_NODE)
  103. #include <mpi.h>
  104. #define msgmid_t MPI_Request 
  105. #define info_t MPI_Status
  106. #define MPPINFOSIZE 1
  107. #else
  108. #define msgmid_t int
  109. #define info_t int
  110. #define MPPINFOSIZE 8
  111. #endif
  112. struct msgfunc {
  113.     int (*imsgsend) __ProtoGlarp__( (int, int, char *, int, int, int, msgmid_t *) );
  114.     int (*imsgrecv) __ProtoGlarp__( (int, int, int, char *, int, int, int *, msgmid_t *) );
  115.     msgmid_t (*msgmerge) __ProtoGlarp__( (msgmid_t *, msgmid_t *) );
  116.     int (*msgdone) __ProtoGlarp__( (int, msgmid_t *, info_t *) );
  117.     int (*msglen) __ProtoGlarp__( (info_t *) );
  118.     int (*msgsrc) __ProtoGlarp__( (info_t *) );
  119.     int (*msgtag) __ProtoGlarp__( (info_t *) );
  120. };
  121.  
  122. typedef struct msgfunc MSGFUNC;
  123. typedef struct msgfunc *MSGFUNC_PTR;
  124.  
  125. /* ======= Function Protoypes ========= */
  126. MSGFUNC_PTR pvm_nodemsgfunc __ProtoGlarp__(());
  127. MSGFUNC_PTR pvm_hostmsgfunc __ProtoGlarp__(());
  128.  
  129. int pvm_mpp_message_init __ProtoGlarp__( (int *, int *, int *, int *) );
  130. int pvm_mpp_message_stop __ProtoGlarp__( () );
  131. #endif /* not defined __mppmsg_h */
  132.